package com.wisdudu.blank.data.exception;

import com.wisdudu.blank.support.util.ToastUtil;

/**
 * Created by qyf on 2016/8/18.
 */
public class ApiException extends RuntimeException {
    //手动抛出异常
    public ApiException(String message) {
        super(message);
        ToastUtil.INSTANCE.toast(message);
    }

    //API返回异常
    public ApiException(int errCode, String message) {
        super(message);
        if (!message.contains("暂无数据") && !message.contains("设备不存在")) {
            ToastUtil.INSTANCE.toast(message);
        }
    }

}
